import pygame

import player, screen


class shot():
    
    def __init__(self):
        self.shot_obj = None
        self.shot_objx = 0
        self.shot_objy = 0
        self.pl = player.player()
        
        
    def init_shot(self):
        self.shot_obj  = None
        self.shot_objx = 0
        self.shot_objy = 0
        
    def do_shot(self):
        self.shot_objx = self.pl.posX+25;
        self.shot_objy = self.pl.posY+25;
        screen.screen.draw_shot()
        
        if self.shot_obj:
            self.shot_objy -= 20
            '''img = pygame.image.load('bullet2.png')
            img = pygame.transform.scale(img, (10,42) )'''
            self.sc.draw_shot2()
            'shot.shot_obj = screen.screen.blit(img, (shot_objx, shot_objy))'
            self.sc.undef_shot()
        
            if self.sh.shot_objx > self.sc.xsize or self.sh.shot_objy > self.sc.screen.ysize:
                self.sh.shot_obj = None
            if shot.shot_objx < 0 or shot.shot_objy < 0:
                self.sh.shot_obj = None